<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2012.03.17.
   家居招标列表显示($$)*/

!defined('Q_PATH') && exit;

class Index_C_Controller extends InitController{

	public function index(){
		// 载入相关缓存
		Core_Extend::loadCache('jiaju_caseclass');
		Core_Extend::loadCache('jiaju_biddinghotcompany'.Core_Extend::getCityCache());// 热门品牌
		
		// 当前城市招标
		$arrWhere=array();
		$arrWhere['A.jiajubidding_status']=1;
		$arrWhere['string_']=Core_Extend::getCitySql('A.');

		$nTotal=Model::F_('jiajubidding','@A')->where($arrWhere)->getCounts();
		$oPage=Page::RUN($nTotal,25,Jiaju_Extend::getBiddingList('{page}',false));
		$arrJiajuBiddings=Model::F_('jiajubidding','@A')
			->setColumns('A.jiajubidding_id,A.jiajubidding_title,A.jiajubidding_realspace,A.jiajubidding_realprice,A.jiajubidding_starttime')
			->where($arrWhere)
			->joinLeft(Q::C('DB_PREFIX').'jiajucompanyclass AS E','E.jiajucompanyclass_name AS space_name','A.jiajubidding_spaceid=E.jiajucompanyclass_id')
			->order('A.jiajubidding_id DESC')
			->limit($oPage->S(),$oPage->N())
			->getAll();

		Core_Extend::getSeo($this,array(
			'title'=>"#cityname#装修招标",
			'keywords'=>"#cityname#装修招标",
			'description'=>"{$GLOBALS['_option_']['site_name']}#cityname#装修网是专业的家装、公装项目招标平台，#cityname#业主可以在{$GLOBALS['_option_']['site_name']}#cityname#装修网免费发布装修招标，多套装修方案PK让#cityname#装修省钱省力更省心!",
		),true,true);

		$this->assign('arrBiddingClasss',$GLOBALS['_cache_']['jiaju_caseclass']);
		$this->assign('arrHotPingpaiJiajucompanys',$GLOBALS['_cache_']['jiaju_biddinghotcompany'.Core_Extend::getCityCache()]);
		$this->assign('arrJiajuBiddings',$arrJiajuBiddings);
		$this->assign('sPageNavbar',$oPage->P(array('id'=>'pagination','style'=>'li','current'=>'active')));
		$this->display();
	}

}
